package com.pig4cloud.pig.village.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 福利事件：个人福利发放、户奖惩变更
 * @author limbray.li
 * @date 2021/6/13
 */
@Data
//@TableName("welfare_event")
public class WelfareEvent {
	private static final long serialVersionUID = 1L;

	@TableId(value = "id", type = IdType.ASSIGN_ID)
	@JsonIgnore
	private Long id;
	@JsonIgnore
	private LocalDateTime createTime;
	@JsonIgnore
	private LocalDateTime updateTime;
	@JsonIgnore
	private String createBy;
	@JsonIgnore
	private String updateBy;
	@JsonIgnore
	@TableLogic(value = "0", delval = "1")
	private String delFlag;
	@JsonIgnore
	private Integer tenantId;
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty(value = "事件时间")
	private LocalDateTime eventTime;
	@ApiModelProperty(value = "发放对象类型",notes = "1:户，2:人")
	private Integer type;
	@ApiModelProperty(value = "发放对象id")
	private Long targetId;
	@ApiModelProperty(value = "金额")
	private BigDecimal amount;

	@ApiModelProperty(value = "福利id")
	private Long welfareId;
	@ApiModelProperty(value = "红黑榜id")
	private Long rewardId;

	//是否用于统计福利数量（0：不统计，1：统计）
	@JsonIgnore
	private Integer collect;
}
